View¶
View can hold children of type Element
. In some case, there is a
restriction on number of children it can hold.
-
class
Aduct.Views.View.
View
(**kwargs)¶ This an abstract class, that gives an idea of methods a
View
must have. Unless otherwise stated, all the description of methods are generalised expected behavior ofView
. Depending upon the nature of view, the type of child it can hold also varies.-
add_child
(child)¶ Adds the child
self
.Parameters: Raises: ValueError
– Raised when there is insufficient information to addchild
toself
.TypeError
– Raised whenchild
is of invalid type.
Note
When there is a lack of information to add
child
,self
may try its best to addchild
in suitable position.
-
get_props
()¶ Gets the interface properties.
Returns: A dictionary with interface properties. Return type: dict
-
get_type
()¶ Gets the interface properties.
Returns: A dictionary with interface properties. Return type: dict
-
remove_child
(child)¶ Removes the given child.
Parameters: child ( View
orElement
) – The child which has to be removed fromself
.Raises: ValueError
– Raises whenchild
is not present inself
.
-
replace_child
(old_child, new_child)¶ Replaces the existing child with new child.
Parameters:
-